package org.feiye.studyday28;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.Arrays;

import org.feiye.studyday21.Student;

public class ByteOutputStreamTest {

	public static void main(String[] args) throws IOException {
		Student s = new Student("老王", "男");
		ByteArrayOutputStream f = new ByteArrayOutputStream();
		ObjectOutputStream o = new ObjectOutputStream(f);
		o.writeObject(s);
		o.close();

		byte[] br = f.toByteArray();
		System.out.println(Arrays.toString(br));

	}

}
